package com.apestech.api.condition.Step;

import com.apestech.api.condition.ConditionStrategyExec;
import com.apestech.framework.db.SqlSession;
import com.apestech.framework.json.JSONObject;
import com.apestech.framework.xml.condition.modul.ConditionStrategy;

public class StepConditionStrategy extends StepPubField {
    private ConditionStrategyExec conditionStrategy;

    public StepConditionStrategy(ConditionStrategy.Step step, ConditionStrategyExec conditionStrategy, SqlSession session) throws Exception {
        super(step, session);
        this.conditionStrategy=conditionStrategy;
        super.setInput(null);
        super.setResultMap(null);
    }

    public ConditionStrategyExec getConditionStrategy() {
        return conditionStrategy;
    }

    @Override
    public void exec() throws Exception {
        conditionStrategy.setInput(super.getInput());
//        conditionStrategy.setStepInfo(stepInfoList);
        conditionStrategy.expain();
        JSONObject o=conditionStrategy.getResultMap();
        finiExec(o, super.getStep());
        super.getStep().setResultMap(o);
    }

}
